package com.shenglue.ssi.service;

import java.util.List;

import com.shenglue.ssi.dao.WarehouseDao;
import com.shenglue.ssi.domain.BuyInMain;
import com.shenglue.ssi.domain.Warehouse;

public class WarehouseServiceImpl implements WarehouseService {

	private WarehouseDao dealerDao;
	
	public WarehouseDao getWarehouseDao() {
		return dealerDao;
	}

	public void setWarehouseDao(WarehouseDao dealerDao) {
		this.dealerDao = dealerDao;
	}

	/**
	 * 查询所有经销商信息
	 */
	public List<Warehouse> selectAllWarehouse() {
		return dealerDao.selectAllWarehouse();
	}

	/**
	 * 增加经销商记录
	 */
	public boolean saveWarehouse(Warehouse dealer){
		return dealerDao.saveWarehouse(dealer);
	}

	/**
	 * 删除经销商记录
	 */
	public boolean deleteWarehouse(int buyInId) {
		return dealerDao.deleteWarehouse( buyInId );
	}

	/**
	 * 修改经销商记录
	 */
	public boolean updateWarehouse(Warehouse dealer){
		return dealerDao.updateWarehouse(dealer);
	}
	/**
	 * 为修改，根据 Id 查一条 入库单主表记录
	 */
	public Warehouse getOneWarehouseForUpdate( int dealerId ){
		
		return dealerDao.getOneWarehouseForUpdate( dealerId );
	}
}
